﻿using System;
using fastCSharp;
using fastCSharp.code.cSharp;

namespace diantou.dataModel.path
{
    /// <summary>
    /// 回答URL
    /// </summary>
    public struct answer
    {
        /// <summary>
        /// 回答标识
        /// </summary>
        public int Id;

        /// <summary>
        /// 格式化URL
        /// </summary>
        /// <param name="name">页面名称/类型</param>
        /// <returns></returns>
        private webView.hashUrl get(string name)
        {
            return new webView.hashUrl { Path = "/answer/" + name + ".html", Query = "answerId=" + Id.toString() };
        }
        /// <summary>
        /// 首页
        /// </summary>
        public webView.hashUrl Index
        {
            get { return get("index"); }
        }
        /// <summary>
        /// 赞同回答的人
        /// </summary>
        public webView.hashUrl Agree
        {
            get { return get("agree"); }
        }
        /// <summary>
        /// 相关收藏
        /// </summary>
        public webView.hashUrl Favorite
        {
            get { return get("favorite"); }
        }
    }
}
